package x.trident.core.micro.api.exception.enums;

import x.trident.core.micro.api.constants.MicroConstants;
import x.trident.core.constants.BaseConstants;
import x.trident.core.exception.AbstractExceptionEnum;
import lombok.Getter;

/**
 * 微服务的异常枚举
 *
 * @author Seven
 * @date 2021/5/10 10:20
 */
@Getter
public enum FeignExceptionEnum implements AbstractExceptionEnum {

    /**
     * feign远程调用资源不存在
     */
    REMOTE_SERVICE_NULL(BaseConstants.BUSINESS_ERROR_TYPE_CODE + MicroConstants.MICRO_EXCEPTION_STEP_CODE + "01", "feign远程调用资源不存在"),

    /**
     * feign远程调用过程出错
     */
    REMOTE_SERVICE_ERROR(BaseConstants.BUSINESS_ERROR_TYPE_CODE + MicroConstants.MICRO_EXCEPTION_STEP_CODE + "02", "feign远程调用过程出错，错误原因：{}"),

    /**
     * feign远程调用过程出错
     */
    REMOTE_IO_ERROR(BaseConstants.BUSINESS_ERROR_TYPE_CODE + MicroConstants.MICRO_EXCEPTION_STEP_CODE + "03", "feign远程调用过程IO异常");

    /**
     * 错误编码
     */
    private final String errorCode;

    /**
     * 提示用户信息
     */
    private final String userTip;

    FeignExceptionEnum(String errorCode, String userTip) {
        this.errorCode = errorCode;
        this.userTip = userTip;
    }

}
